package com.qf.controller;



import com.qf.pojo.Area;
import com.qf.service.AreaService;
import com.qf.service.impl.AreaServiceImpl;


import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

//@WebServlet("/area")
public class AreaController extends Base{
    private AreaService areaService=new AreaServiceImpl();


    public String getCityArea(HttpServletRequest req, HttpServletResponse resp){
        String pid=req.getParameter("pid");
        String cid=req.getParameter("cid");
        List<Area> cityAreaList=null;
        if(pid!=null){
            cityAreaList=areaService.getCity(Integer.valueOf(pid));
        }  else if(cid!=null){
            cityAreaList=areaService.getArea(Integer.valueOf(cid));
        }
//        String res= JSON.toJSONString(cityAreaList);
        String res=new String();
        return res;
    }
}
